<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改researchers')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-researchers-edit" th:object="${researchers}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">姓名：</label>
                    <div class="col-sm-8">
                        <input name="researchersName" th:field="*{researchersName}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">职称：</label>
                    <div class="col-sm-8">
                        <select name="title" class="form-control" th:with="type=${@dict.getType('title')}" required>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{title}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">联系方式：</label>
                    <div class="col-sm-8">
                        <input name="contactInfo" th:field="*{contactInfo}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">学院/机构：</label>
                    <div class="col-sm-8" th:with="type=${@dict.getType('my_department')}">
                        <label th:each="dict : ${type}" class="check-box">
                            <input name="department" type="checkbox" th:value="${dict.dictValue}" th:text="${dict.dictLabel}" th:attr="checked=${researchers.department.contains(dict.dictValue)?true:false}" required>
                        </label>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">研究方向概述：</label>
                    <div class="col-sm-8">
                        <textarea name="researchOverview" class="form-control" required>[[*{researchOverview}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">关键词标签：</label>
                    <div class="col-sm-8">
                        <textarea name="researchArea" class="form-control" required>[[*{researchArea}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">已发表论文、工作论文：</label>
                    <div class="col-sm-8">
                        <textarea name="articleAchievement" class="form-control">[[*{articleAchievement}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">专著、编著等：</label>
                    <div class="col-sm-8">
                        <textarea name="workAchievement" class="form-control">[[*{workAchievement}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">在研与已完成项目：</label>
                    <div class="col-sm-8">
                        <textarea name="researchProject" class="form-control">[[*{researchProject}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">团队成员信息：</label>
                    <div class="col-sm-8">
                        <textarea name="researchTeam" class="form-control">[[*{researchTeam}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">专利信息：</label>
                    <div class="col-sm-8">
                        <textarea name="patentInformation" class="form-control">[[*{patentInformation}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">资政成果：</label>
                    <div class="col-sm-8">
                        <textarea name="politicalConsultationAchievements" class="form-control">[[*{politicalConsultationAchievements}]]</textarea>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">创建时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="createdAt" th:value="${#dates.format(researchers.createdAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" required>
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">更新时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="updatedAt" th:value="${#dates.format(researchers.updatedAt, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "cross/researchers";
        $("#form-researchers-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-researchers-edit').serialize());
            }
        }

        $("input[name='createdAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='updatedAt']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>